home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / blitzbasic / blitz-list200994.lha / blitz-list / text0544.txt < prev    next >
Encoding:
Text File  |  1994-09-20  |  997 b   |  30 lines

  1. Ok I looked thru the Ref. Manual and I found this interesting little
  2. hack.  I say hack because I'm sure it's probably not a good idea to do
  3. stuff like this, but hey, taking over the system isn't very nice either
  4. :).  Anyway, use this at your own risk.  All it does is check the bit in
  5. PRB to see whether the disk motor is on or not.  It SAYS in the manual
  6. that this bit also tells you whether the drive light is on or off, so it
  7. should work.  I dunno ... all I can say is try it on a blank floppy
  8. before you use it on DH0: .. here it is:
  9.  
  10. ; (hopefully) waits until disk activity
  11. ; is done after startup and allows the program to continue (to avoid
  12. ; messing up the disk when taking over the system).
  13.  
  14. CIA_B_PRB    equ $bfd100            ; Peripheral Data Reg. Port B
  15.  
  16. WaitForDiskActivityToFinish:
  17.  
  18.     move.b CIA_B_PRB,d0
  19.     and.b #%10000000,d0            ; check the 8th bit
  20.     cmp.b #0,d0                ; if it's equal to 0, then...
  21.     beq.s WaitForDiskActivityToFinish    ; the motor is on, so loop...
  22.  
  23.  
  24.  
  25.  
  26.  
  27. William Nolan (wn22@cmu.edu)
  28.  
  29.  
  30.